import { EntitySchema } from '@mikro-orm/core';

export class LeWaybill {
  id!: string;
  code!: string;
  name!: string;
  mobile!: string;
  province!: string;
  city!: string;
  district!: string;
  address!: string;
  AppID!: string;
  merchantId!: string;
  createdTime?: number = 0;
  updatedTime?: number = 0;
  deletedTime?: number = 0;
  isDeleted?: number = 0;
}

export const LeWaybillSchema = new EntitySchema({
  class: LeWaybill,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    code: { type: 'string', length: 10 },
    name: { type: 'string', length: 256 },
    mobile: { type: 'string', length: 32 },
    province: { type: 'string', length: 50 },
    city: { type: 'string', length: 50 },
    district: { type: 'string', length: 50 },
    address: { type: 'string', length: 255 },
    AppID: { type: 'string', fieldName: 'AppID', length: 50 },
    merchantId: { type: 'string', columnType: 'bigint' },
    createdTime: { type: 'number', nullable: true, default: 0 },
    updatedTime: { type: 'number', nullable: true, default: 0 },
    deletedTime: { type: 'number', nullable: true, default: 0 },
    isDeleted: { type: 'number', columnType: 'tinyint', nullable: true, default: 0 },
  },
});
